package Book;

import User.NormalUser;
import User.Users;
import User.VIPUser;

import java.util.Scanner;

public class Main {
    public static Users func(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入您的姓名：");
        String Name = scanner.nextLine();
        System.out.println("请选择您的身份：1.管理员 2.读者");
        int choice = scanner.nextInt();
        if(choice == 1){
            return new VIPUser(Name);
        }else {
            return new NormalUser(Name);
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        BookList bookList = new BookList();
        Users users = func();
        while (true){
            users.menu();
            System.out.println("请选择：");
            int choice = scanner.nextInt();
            users.ioperations[choice].work(bookList);
        }
    }
}
